Parameterized LR Parsing

نویسندگان

  • Peter Thiemann
  • Matthias Neubauer
چکیده

Common LR parser generators lack abstraction facilities for defining recurring patterns of productions. Although there are generators capable of supporting regular expressions on the right hand side of productions, no generator supports user defined patterns in grammars. Parameterized LR parsing extends standard LR parsing technology by admitting grammars with parameterized non-terminal symbols. A generator can implement such a grammar in two ways, either by expansion or directly. We develop the theory required for the direct implementation and show that it leads to significantly smaller parse tables and that it has fewer parsing conflicts than the expanded grammar. Attribute evaluation for a parameterized non-terminal is possible in the same way as before, if the semantic functions related to the non-terminal are polymorphic with respect to the parameter. We have implemented parameterized LR parsing in the context of Essence, a partial-evaluation based LR parser generator for Scheme.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Unifying LL and LR parsing

In parsing theory, LL parsing and LR parsing are regarded to be two distinct methods. In this paper the relation between these methods is cla-riied. As shown in literature on parsing theory, for every context-free grammar, a so-called non-deterministic LR(0) automaton can be constructed. Here, we show, that traversing this automaton in a special way is equivalent to LL(1) parsing. This automato...

متن کامل

Lr Parsing = Grammar Transformation + Ll Parsing Making Lr Parsing More Understandable and More Eecient

The paper has three aims. Its primary focus is a derivation method which is | in contrast to many of the classical presentations in the literature | easy to comprehend and thus easy to adapt to di erent needs. Secondly, it presents an improved LR parser which has the power of LR parsing, but (almost) the e ciency of LALR parsing. Finally, it elucidates the strong conceptual relationships that a...

متن کامل

Faster Generalized LR Parsing

Tomita devised a method of generalized LR (GLR) parsing to parse ambiguous grammars e ciently. A GLR parser uses linear-time LR parsing techniques as long as possible, falling back on more expensive general techniques when necessary. Much research has addressed speeding up LR parsers. However, we argue that this previous work is not transferable to GLR parsers. Instead, we speed up LR parsers b...

متن کامل

GLR Parser with Conditional Action Model(CAM)

There are two different approaches in the LR parsing. The first one is the deterministic approach that performs the only one action using the control rules learned without any LR parsing resource. It shows good performance in speed. But it has a disadvantage that it cannot correct the previous mistakes, thus directly affects the parsing result. The second one is the probabilistic LR parsing app...

متن کامل

An Efficient Augmented-Context-Free Parsing Algorithm

An efficient parsing algorithm for augmented context-free grammars is introduced, and its application to on-line natural language interfaces discussed. The algorithm is a generalized LR parsing algorithm, which precomputes an LR shift-reduce parsing table (possibly with multiple entries) from a given augmented context-free grammar. Unlike the standard LR parsing algorithm, it can handle arbitra...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Electr. Notes Theor. Comput. Sci.

دوره 110  شماره 

صفحات  -

تاریخ انتشار 2004